package cn.christ.com.mobilesafe.view.activity_setting;

import android.widget.ImageView;
import android.widget.RelativeLayout;
import android.widget.TextView;

import butterknife.BindView;
import butterknife.OnClick;
import cn.christ.com.mobilesafe.R;
import cn.christ.com.mobilesafe.common.BaseActivity;
import cn.christ.com.mobilesafe.common.utils.SPUtils;
import cn.christ.com.mobilesafe.constant.Constants;

/**
 * Created by Administrator on 2018/7/20.
 */

public class SettingActivity extends BaseActivity {

    @BindView(R.id.tv_seting_title)
    TextView tvSetingTitle;
    @BindView(R.id.iv_setting_update)
    ImageView ivSettingUpdate;
    @BindView(R.id.rl_doUpdateVersion)
    RelativeLayout rlDoUpdateVersion;
    private boolean update;

    @Override
    public int getLayoutRes() {
        return R.layout.activity_setting;
    }

    @Override
    public void initView() {
        super.initView();
        update = (boolean) SPUtils.get(Constants.UPDATE_VERSION, false);
        ivSettingUpdate.setImageResource(update ? R.drawable.on : R.drawable.off);
    }

    @OnClick(R.id.rl_doUpdateVersion)
    public void onViewClicked() {
        if (update) {
            SPUtils.put(Constants.UPDATE_VERSION, false);
            ivSettingUpdate.setImageResource(R.drawable.off);
        } else {
            SPUtils.put(Constants.UPDATE_VERSION, true);
            ivSettingUpdate.setImageResource(R.drawable.on);
        }
        update = !update;
    }

    @Override
    public void initListener() {

    }

    @Override
    public void initData() {

    }

    @Override
    public void initPresenter() {

    }


}
